var mongoose = require("mongoose");

//历史表(history)
var historySchema = new mongoose.Schema({
  articleid: {
    type: mongoose.SchemaTypes.ObjectId,
    ref: "article",
    required: true
  }, //文章id
  artictype: { type: String, required: true }, //文章类型
  userid: {
    type: mongoose.SchemaTypes.ObjectId,
    ref: "user_login",
    required: true
  }, //用户id
  history_time: { type: Date, default: new Date() } //历史时间
});

module.exports = mongoose.model("history", historySchema);
